home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / standards / ansi / X3T9 / area13 / phystolg.txt < prev    next >
Encoding:
Text File  |  1992-05-12  |  5.2 KB  |  113 lines

  1.     To:      SCSI-2 CAM Committee
  2.     From:    Judy Polonsky
  3.     Subject: Physical to/from Logical Block Address Conversion
  4.  
  5.         Fixed  disk  boot  devices are described physically in  terms  of 
  6.         CYLINDER/HEAD/SECTORS  per TRACK through BIOS INT  13h,  function 
  7.         08h  and by drive geometry table pointers INT 41h (drive  0)  and 
  8.         INT  46h  (drive 1).   Operating  systems  (DOS,  Xenix,  Novell, 
  9.         OS/2,etc.)  use  the INT 13h call and/or examine the INT  41h/46h 
  10.         tables  directly  to determine device capacity and to  issue  I/O 
  11.         requests  before O/S-specific ram-resident drivers are  installed 
  12.         (which in some cases, continue to use the INT 13h protocol).  The 
  13.         standard partition table structure,  the means by which each  O/S 
  14.         determines  which  portion  of the device it  "owns",  also  uses 
  15.         CYLINDER/HEAD/SECTOR   to  specify  beginning/end  of   a   given 
  16.         partition.   Both  the INT 13h interface and the partition  table 
  17.         define  10  bits for cylinder,  8 bits for head,  and 6 bits  for 
  18.         sector.  Since  boot  code  uses  the  physical  address  in  the 
  19.         partition  table  to load in a given  OS's  partition,  a  common 
  20.         algorithm by which to convert SCSI logical block capacity to this 
  21.         physical  interface  is  essential  for  devices  such  as  fixed 
  22.         removable media to maintain bootability across different host bus 
  23.         adapters. 
  24.  
  25.         A  standard  conversion  algorithm could be based on  fake  fixed 
  26.         physical  parameters  which bear no relation  to  real  geometry, 
  27.         based on actual mode sense geometry within the bit constraints of 
  28.         INT 13h interface, or based on some combination of the above.
  29.  
  30.         Options for converting logical to physical capacity would be  the 
  31.         following ( comments /criticisms needed!):
  32.  
  33.  
  34.         I.  Ignoring mode sense geometry
  35.  
  36.              a)  Heads  and Secs/trk fixed at maximum values (256 and  64 
  37.         repectively)  - 
  38.  
  39.              This  has advantage of being straightforward but  can  waste 
  40.         alot  of disk space on the remainder of the disk which can't  fit 
  41.         into  an integral "cylinder" - up to 8MB (256 hds * 64 spt *  512 
  42.         bytes). 
  43.  
  44.              b)   Heads and Secs/trk fixed initially at small  values  (4 
  45.         and  17  respectively)  - 
  46.  
  47.              Calculate  "cyls" as a function of fixed heads and  spt.  If 
  48.         they  don't fit (> 1024),  heads or spt can be bumped til logical 
  49.         capacity is fully described. 
  50.  
  51.         Starting with 17 secs per track has the advantage of  maintaining 
  52.         compatibility  some O/S 's - old versions of DOS, Novell -  which 
  53.         assume 17 secs/trk.  However,  it can result in greater number of 
  54.         smaller  I/O  requests under DOS versions which don't cross  head 
  55.         boundaries  than an algorithm which created larger  "tracks"  and 
  56.         fewer heads.   Don't care under Unix/Xenix,Novell,etc.  since the 
  57.         requests are fixed block sizes in those environments.
  58.  
  59.          
  60.         II.  Using Mode Sense Geometry
  61.  
  62.         If  actual geometry parameters returned by MODE sense fit  within 
  63.         the  imposed  bit  constraints  ,   use  them.  This  allows  for 
  64.         performance tuning.  (NOTE:  actual capacity reported to O/S does 
  65.         not include areas reserved by drive for defect management  - READ 
  66.         CAPACITY  results  is probably the actual logical capacity to  be 
  67.         described physically.  Also,  the last "cylinder" is reserved  by 
  68.         INT 13h bios drivers for diagnostics ).
  69.  
  70.         If actual geometry does not fit,  there are several options:
  71.  
  72.         1) Truncation of cyls or spt ( whatever doesn't fit) - not a good 
  73.         option as much capacity can be lost.
  74.  
  75.         2) Default to one of the algorithms in I.  above (no relation  to 
  76.         actual geometry).
  77.  
  78.         3)  Adjust  remaining two physical parameter til the  overflowing 
  79.         parameter  is  within its maximum allowable value  (1024  cyls,64 
  80.         spt)  starting  from their actual mode sense values  rather  than 
  81.         some small or large fixed defaults. 
  82.  
  83.         Example.  Cylinders too large -
  84.           
  85.              a)  Bump  heads exclusively till cylinders fit or  max  head 
  86.         value is reached.  If max head is reached, bump secs/trk til cyls 
  87.         fit  or  max secs/trk is reached.  If max secs/trk is  reached  , 
  88.         cylinders should be set to max cylinders (256 hds * 64 spt * 1024 
  89.         cyls = 8 gigabytes).
  90.  
  91.              b) Bump spt exclusively till cylinders fit or max spt  value 
  92.         is  reached.   If max spt is reached,  bump heads til cyls fit or 
  93.         max heads is reached.  If max heads is reached , cylinders should 
  94.         be  set  to  max  cylinders (256 hds * 64 spt *  1024  cyls  =  8 
  95.         gigabytes).
  96.  
  97.         Example.  Sectors per Track too large -
  98.  
  99.              Leaving  cylinders fixed,  set sectors per track to  maximum 
  100.         allowable  value  and  calculate heads as a function of  these  2 
  101.         values. 
  102.  
  103.  
  104.         Example.  Sectors per track and Cylinders too large -
  105.  
  106.              Set cylinders and secs per track to their maximum  allowable 
  107.         values and calculate heads as a function of these two values.
  108.  
  109.  
  110.  
  111.  
  112.  
  113.